import AuthRoute from "@/components/AuthRoute/AuthRoute";
import Article from "@/pages/Article/Article";
import Home from "@/pages/Home/Home";
import Layout from "@/pages/Layout/Layout";
import Login from "@/pages/Login/Login";
import Publish from "@/pages/Publish/Publish";
import { createBrowserRouter } from 'react-router-dom';

// 基础ReactRouter配置
const router = createBrowserRouter([
    {
        path: '/', element: <Layout />, children: [
            { index: true, element: <AuthRoute><Home /></AuthRoute> },
            { path: 'article', element: <Article /> },
            { path: 'publish', element: <Publish /> }
        ]
    },
    { path: '/login', element: <Login /> },
]);

export default router;